#region license
# This file is part of Grawlix.
# 
# Grawlix is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
# 
# Grawlix is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public
# License along with Grawlix.  If not, see
# <http://www.gnu.org/licenses/>.
#endregion

"""Configuration data for ServiceProviders."""

namespace Grawlix.Services
import C5
import System

class ServiceConfiguration:
"""Configuration data for ServiceProviders."""
	
	def constructor():
	"""
	Construct an empty set of configuration data.
	"""
		_friendlyName = "Untitled"
	
	def constructor(
		[required] friendlyName as string,
		[required] converters as ConverterInfo*,
		[required] services as ServiceInfo*):
	"""
	Construct a new set of configuration data.
	Param friendlyName: The name to use for the ServiceProvider.
	Param services: The list of services available.
	"""
		_friendlyName = friendlyName
		# AddAll not working, see BOO-1076
		for converter in converters:
			_converters.Add(converter)
		for service in services:
			_services.Add(service)
	
	override def ToString():
	"""
	Gets a string representation for this object.
	Returns: A string representation for this object.
	"""
		return "ServiceConfiguration ${FriendlyName}"
	
	[getter(FriendlyName)]
	private _friendlyName = "Untitled"
	"""A friendly name for the provider."""
	
	Converters as IList[of ConverterInfo]:
	"""The list of type converters to provide."""
		get:
			return GuardedList[of ConverterInfo](_converters)
	
	private _converters = ArrayList[of ConverterInfo]()
	"""The list of type converters to provide."""
	
	Services as IList[of ServiceInfo]:
	"""The list of services to provide."""
		get:
			return GuardedList[of ServiceInfo](_services)
	
	private _services = ArrayList[of ServiceInfo]()
	"""The list of services to provide."""
